<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
    
    <ui:composition template="/resources/templates/default.xhtml">
        <ui:define name="title">Logs</ui:define>
        <ui:define name="titlePage">Logs</ui:define>
        <ui:define name="cssStyle">
            
        </ui:define>
        <ui:define name="content">
            <p:layout>
                <p:layoutUnit position="north">
                    <p:panel header="Navigation">
                        <p:toolbar>
                            <f:facet name="left">
                                <h:form id="backForm">
                                    <p:commandButton action="/admin/logs_day" value="Retour" ajax="false"/>
                                </h:form>
                            </f:facet>
                            <f:facet name="right">
                                <h:form id="topsiteForm">
                                    <p:commandButton value="Top sites général"/>
                                </h:form>
                            </f:facet>
                        </p:toolbar>
                    </p:panel>
                </p:layoutUnit>
                <p:layoutUnit position="west" size="250">
                    <p:panel header="Informations du site">
                        <p:panelGrid columns="2" style="width: 100%;">
                            <h:outputText value="Nom"/><h:outputText value="#{topSitesBean.generalTopSite.domaine}"/>
                        </p:panelGrid>
                    </p:panel>
                </p:layoutUnit>
                <p:layoutUnit position="center">
                    <p:panel header="Listes des étudiants avec leur nombre de visites">
                        <h:form>
                            <p:dataTable id="dataSite" value="#{topSitesBean.listEtudiantsVisites}" var="ev">
                                <p:column headerText="IP" sortBy="#{ev.ip}">
                                    <h:outputText value="#{ev.ip}"/>
                                </p:column>
                                <p:column headerText="NOM" sortBy="#{ev.nom}">
                                    <h:outputText value="#{ev.nom} #{ev.prenom}"/>
                                </p:column>
                                <p:column headerText="VISITES" sortBy="#{ev.visites}">
                                    <h:outputText value="#{ev.visites}" />
                                </p:column>
                                <p:column headerText="Action">
                                    <p:commandButton value="Voir logs" action="student" ajax="false" actionListener="#{logsBean.changeEtudiantSelectedByID(ev.id)}"/>
                                </p:column>
                            </p:dataTable>
                        </h:form>
                    </p:panel>
                </p:layoutUnit>
            </p:layout>
            
        </ui:define>

    </ui:composition>
</html>
